package com.saodisheng.model;

import com.saodisheng.enums.GenderEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * description:
 * 成绩类
 *
 * @author 01420175_liuxingwu
 * @date 2022/2/8
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ScoreRecord {
    /** 性别 **/
    private String gender;
    /** 年级 **/
    private String grade;
    /** 身高 **/
    private Float height;
    /** 体重 **/
    private Float weight;
    /** 肺活量 **/
    private Float vitalCapacity;
    /** 坐位体前屈 **/
    private Float sittingBodyFlexion;
    /** 立定跳远 **/
    private Float standingLongJump;
    /** 短跑，即50米 **/
    private Float sprint;
    /** 长跑，男生：1000米，女生：800米 **/
    private Float longDistanceRun;
    /** 其他项目，男生：引体向上，女生：仰卧起坐 **/
    private Integer otherItem;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("体测成绩为：{");
        sb.append("\n性别：" + gender);
        sb.append("\n年级：" + grade);
        sb.append("\n身高：" + height + "厘米");
        sb.append("\n体重：" + weight + "千克");
        sb.append("\n肺活量：" + vitalCapacity + "毫升");
        sb.append("\n坐位体前屈：" + sittingBodyFlexion + "厘米");
        sb.append("\n立定跳远：" + standingLongJump + "厘米");
        sb.append("\n50米：" + sprint + "秒");

        if (GenderEnum.M.getName().equals(gender)) {
            sb.append("\n1000米：" + longDistanceRun + "秒");
            sb.append("\n引体向上：" + otherItem + "次");
        } else {
            sb.append("\n800米：" + longDistanceRun + "秒");
            sb.append("\n仰卧起坐：" + otherItem + "次");
        }
        sb.append("\n}");

        return sb.toString();
    }
}
